#include "basicoperation.h"
#include "common.h"
#include "encryption.h"
#include "e_oneround.h"

void encryption( word *ciphertext , word *key )
{
// 	for ( int i = 0 ; i <= 3 ; ++i )
// 	{
// 		ciphertext[i] = plaintext[i] ;
// 	}
	ciphertext[1] = ciphertext[1] + key[0] ;
	ciphertext[3] = ciphertext[3] + key[1] ;
	for ( int i = 1 ; i <= r ; ++i )
	{
		e_oneround( ciphertext , key[2*i] , key[2*i+1] ) ;
	}
	ciphertext[0] = ciphertext[0] + key[2*r+2] ;
	ciphertext[2] = ciphertext[2] + key[2*r+3] ;
}